unit Hello;

interface

uses
  DFrame.Common, DFrame.CoreService;

type

  THelloService = class(TBaseService)
  protected
    procedure OnLoad(); override;
    procedure OnUnload(); override;
  published
    procedure MainHandler(sender:ICoreService; ev:TServiceEvent);
  end;

implementation

uses Windows;

{ THelloService }

procedure THelloService.MainHandler(sender: ICoreService; ev: TServiceEvent);
begin
  Logger.info('hello!');
end;

procedure THelloService.OnLoad;
begin
  Logger.info('onload');
end;

procedure THelloService.OnUnload;
begin
  Logger.info('onUnload');
end;

initialization
  {$IFDEF DEBUG}OutputDebugString('init hello');{$ENDIF}
  RegisterCoreServiceClass(THelloService, false, true);
  {$IFDEF DEBUG}OutputDebugString('init hello ok');{$ENDIF}

finalization
  {$IFDEF DEBUG}OutputDebugString('finalize hello');{$ENDIF}
  UnRegisterCoreServiceClass(THelloService);
  {$IFDEF DEBUG}OutputDebugString('finalize hello ok');{$ENDIF}


end.
